package com.cskaoyan.bean.vo;

import com.cskaoyan.bean.po.MarketGoods;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
public class WXGoodsRelatedVo {
    /**
     * total : 45
     * pages : 8
     * limit : 6
     * page : 1
     * list : [{"brief":"无","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/5wwfv36pp2z90g16u8mi.jpg","name":"412411","counterPrice":412414,"id":1181057,"isNew":true,"retailPrice":100,"isHot":false},{"brief":"简介","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/r2c4csat4rktf1zjb787.png","name":"aaaaaaa","counterPrice":33,"id":1181056,"isNew":true,"retailPrice":999,"isHot":true},{"brief":"dd","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/at63qxi7xuhvihra9tpi.jpg","name":"小狗","counterPrice":999,"id":1181052,"isNew":true,"retailPrice":2,"isHot":false},{"brief":"1111111111","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/ds71de09pvvj5dsrj1o0.png","name":"小飞机","counterPrice":99,"id":1181027,"isNew":true,"retailPrice":11,"isHot":false},{"brief":"哈哈哈哈哈","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/t2skpada8rmvwe2s3c8o.jpg","name":"哈哈哈","counterPrice":111,"id":1181026,"isNew":true,"retailPrice":1,"isHot":false},{"brief":"哇哈哈哈哈","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/wv7ph96rg3wvdvbshqfe.png","name":"大帅哥一枚","counterPrice":112,"id":1181008,"isNew":true,"retailPrice":80,"isHot":true}]
     */
    private int total;
    private int pages;
    private int limit;
    private int page;
    private List<ListEntity> list = new ArrayList<>();

    public void setListEntity(MarketGoods marketGoods){
        ListEntity listEntity = new ListEntity();
        BeanUtils.copyProperties(marketGoods,listEntity);
        list.add(listEntity);
    }

    @Data
    public class ListEntity {
        /**
         * brief : 无
         * picUrl : http://182.92.235.201:8083/wx/storage/fetch/5wwfv36pp2z90g16u8mi.jpg
         * name : 412411
         * counterPrice : 412414.0
         * id : 1181057
         * isNew : true
         * retailPrice : 100.0
         * isHot : false
         */
        private String brief;
        private String picUrl;
        private String name;
        private BigDecimal counterPrice;
        private Integer id;
        private Boolean isNew;
        private BigDecimal retailPrice;
        private Boolean isHot;

    }
}
